<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
</head>
<style type="text/css">
</style>
<form class="mui-input-group">
	<div class="mui-input-row">
		<label>用户名:</label> <input type="text" value=${ loginUser.loginName }
			disabled> <span class="must">不可修改</span>
	</div>
	<div class="mui-input-row">
		<label>旧密码:</label> <input type="password" name="oldPassWord"
			autocomplete="off" placeholder="请输入旧密码" id="oldPassword">
	</div>
	<div class="mui-input-row">
		<label>新密码:</label> <input type="password" name="newPassWord"
			autocomplete="off" placeholder="请输入新密码" id="newPassWord">
	</div>
	<div class="mui-input-row">
		<label>确认密码:</label> <input type="password" name="surePassWord"
			autocomplete="off" placeholder="请确认密码" id="surePassWord">
	</div>
	<div class="mui-button-row">
		<a type="button" class="mui-btn mui-btn-primary submit">提交</a>
	</div>
</form>
<script type="text/javascript">
    	mui('#offCanvasContentScroll').scroll().scrollTo(0,0);
    
    	$(".mui-title").html("修改密码");
	    $(".submit").on("touchstart",function(){
		    var param = $("form").serialize();
		    
		    if($("#surePassWord").val() != $("#newPassWord").val()){
		    	mui.toast("密码不一致");
		    }else{
				$.post("/main/updateMyPsssWord",param,function(res){
					if(res.success){
						mui.toast("修改成功,请重新登录");
						window.location.href = "/logout";
			    	}else{
			    		mui.toast(res.message);
			    	}
				})
		    }
		    
	   })
	   
	</script>
</html>